package cn.edu.xmu.orderpayment.order.microservice.service;

import cn.edu.xmu.orderpayment.order.microservice.retvo.CouponRetVoForPayment;
import cn.edu.xmu.orderpayment.order.microservice.retvo.PointUseRetVo;
import cn.edu.xmu.orderpayment.order.microservice.retvo.SimpleCustomerRetVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Yujie Lin
 * @date 2021/12/9 20:14
 */
@FeignClient("customer-service")
public interface CustomerService {
    @GetMapping("internal/coupon/{id}")
    InternalReturnObject<CouponRetVoForPayment> getCouponById(@PathVariable Long id);

    @PutMapping("internal/coupon/{id}")
    InternalReturnObject useCoupon(@PathVariable Long id);

    @PutMapping("internal/coupon/{id}/refund")
    InternalReturnObject refundCoupon(@PathVariable Long id);

    @PutMapping("internal/customer/{id}/point")
    InternalReturnObject<PointUseRetVo> usePoint(@PathVariable Long id, @RequestParam Long point);

    @PutMapping("internal/customer/{id}/point/refund")
    InternalReturnObject refundPoint(@PathVariable Long id, @RequestParam Long point);

    @GetMapping("internal/customer/{id}")
    InternalReturnObject<SimpleCustomerRetVo> getCustomerById(@PathVariable Long id);
}
